<template>
	<div>
		<div style="margin-top: 40%;">
			<van-button color="#4142F4" type="primary" block @click="new_pj_ware()">新配件入库</van-button>
		</div>
		<div style="margin-top: 10%;">
			<van-button color="#4142F4" type="primary" block @click="old_pj_ware()">废旧材料入库</van-button>
		</div>
	</div>
</template>

<script>
	import { BaseUrl } from '@/util/util.js';
	const PrefixUrl = BaseUrl();
	export default {
		data(){
			return{
				material_id: '',
				material_name: '',
				material_model: '',
				equiment_source: '',
				equiment_manu: '',
				material_code: '',
				warehouse_cess: '',
				warehouse_money: ''
			}
		},
		onLoad: function(option) {
			this.material_id = option.id;
			this.material_name = option.name;
			this.material_model = option.model;
			this.equiment_source = option.equimentSource;
			this.equiment_manu = option.equimentManu;
			this.material_code = option.materialCode;
			this.warehouse_cess = option.materialCess;
			this.warehouse_money = option.materialMoney;
			
		},
		created() {
			
		},
		methods:{
			new_pj_ware(){
				uni.redirectTo({
					url: '/pages/equipment/ware/ware_detail?id=' + this.material_id +
						'&name=' + this.material_name + '&model=' + this.material_model + 
						'&equimentSource=' + this.equiment_source + '&equimentManu=' + this.equiment_manu +
						'&materialCode=' + this.material_code  + '&materialCess=' + this.warehouse_cess + 
						'&materialMoney=' + this.warehouse_money
				});
			},
			old_pj_ware(){
				uni.redirectTo({
					url: '/pages/equipment/ware/old_ware?id=' + this.material_id +
						'&name=' + this.material_name + '&model=' + this.material_model + 
						'&equimentSource=' + this.equiment_source + '&equimentManu=' + this.equiment_manu +
						'&materialCode=' + this.material_code
				});
			}
		}
	} 
</script>

<style>
</style>